package fr.mywiki.business.utils;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

public class CollectUtilsTest extends TestCase {
	/**
   * @see CollectUtils#indexOf(List, Object, int)
   */
	public void testIndexOf() {
		ArrayList list = new ArrayList();
		list.add("a");
		list.add("b");
		list.add("c");
		list.add("d");
		list.add("a");
		list.add("e");
		list.add("f");
		list.add("g");
		assertEquals(0, list.indexOf("a"));
		assertEquals(0, CollectUtils.indexOf(list, "a", 0));
		assertEquals(4, CollectUtils.indexOf(list, "a", 1));
		assertEquals(4, CollectUtils.indexOf(list, "a", 2));
		assertEquals(4, CollectUtils.indexOf(list, "a", 4));
		assertEquals(-1, CollectUtils.indexOf(list, "a", 5));
	}
}
